import request from './request';

export function request_login(params) {
    return request.post('/admin/login', params)
}

export function request_logout(params) {
    return request.post('/admin/logout', params)
}

// 余额变动列表
export function request_balance_list(params) {
    return request.post('/admin/user/getBlanceLog', params)
}

// 卡密列表
export function request_code_list(params) {
    return request.post('/admin/setting/getCodes', params)
}

// 获取洗车记录
export function request_distinguish_log(params) {
    return request.post('/admin/order/getDistinguishLog', params)
}

// 生成工位二维码
export function request_build_qrcode(params) {
    return request.post('/admin/station/buildQrCode', params)
}

// 操作门
export function request_operate_door(params) {
    return request.post('/admin/station/operateDoor', params)
}
// 导出卡密
export function request_download_bride(params) {
    request.post('/admin/bride/getCodes', params, { responseType: 'blob' }).then(function (response) {
        const url = window.URL.createObjectURL(new Blob([response.data]))
        const link = document.createElement('a')
        link.href = url
        link.setAttribute('download', '用户管理.xlsx')
        document.body.appendChild(link)
        link.click()
    })
}
// 导出卡密
export function request_download_form(params) {
    request.post('/admin/setting/getCodes', params, { responseType: 'blob' }).then(function (response) {
        const url = window.URL.createObjectURL(new Blob([response.data]))
        const link = document.createElement('a')
        link.href = url
        link.setAttribute('download', '卡密管理.xlsx')
        document.body.appendChild(link)
        link.click()
    })
}

export function request_content_get(params) {
    return request.post('/admin/setting/getContent', params)
}

export function request_content_update(params) {
    return request.post('/admin/setting/updateContent', params)
}

// 删除订单
export function request_order_delete(params) {
    return request.post('/admin/order/deleteCarOrder', params)
}

// 车辆列表
export function request_cars(params) {
    return request.post('/admin/car/getList', params)
}

// 用户列表
export function request_users(params) {
    return request.post('/admin/user/getList', params)
}

// 充值订单
export function request_exchange_order(params) {
    return request.post('/admin/order/getList', params)
}

// 卡密兑换
export function request_build_code(params) {
    return request.post('/admin/setting/buildCode', params)
}

// 套餐
export function request_package_list(params) {
    return request.post('/admin/setting/getListByPackage', params)
}

export function request_package_create(params) {
    return request.post('/admin/setting/createByPackage', params)
}

export function request_package_update(params) {
    return request.post('/admin/setting/updateByPackage', params)
}

export function request_package_delete(params) {
    return request.post('/admin/setting/deleteByPackage', params)
}
//资讯

export function request_information_detail(params) {
    return request.post('/admin/information/read', params)
}
export function request_information_list(params) {
    return request.post('/admin/information/index', params)
}
export function request_information_create(params) {
    return request.post('/admin/information/create', params)
}

export function request_information_update(params) {
    return request.post('/admin/information/update', params)
}

export function request_information_delete(params) {
    return request.post('/admin/information/delete', params)
}
//婚宴列表
// 用户列表
export function request_bride_list(params) {
    return request.post('/admin/bride/index', params)
}
//请柬
export function request_invite_detail(params) {
    return request.post('/admin/invite/read', params)
}
export function request_invite_list(params) {
    return request.post('/admin/invite/index', params)
}
export function request_invite_create(params) {
    return request.post('/admin/invite/create', params)
}

export function request_invite_update(params) {
    return request.post('/admin/invite/update', params)
}

export function request_invite_delete(params) {
    return request.post('/admin/invite/delete', params)
}
//酒店

export function request_hotel_detail(params) {
    return request.post('/admin/hotel/read', params)
}
export function request_phone_list(params) {
    return request.post('/admin/hotel/phonelist', params)
}
export function request_hotelType_list(params) {
    return request.post('/admin/hotel/getHotelType', params)
}
export function request_hotel_list(params) {
    return request.post('/admin/hotel/index', params)
}
export function request_area_list(params) {
    return request.post('/admin/hotel/getQuyu', params)
}
export function request_hotel_create(params) {
    return request.post('/admin/hotel/create', params)
}

export function request_hotel_update(params) {
    return request.post('/admin/hotel/update', params)
}

export function request_hotel_delete(params) {
    return request.post('/admin/hotel/delete', params)
}
//宴会厅
export function request_zhuoshu_list(params) {
    return request.post('/admin/hall/getDesk', params)
}
export function request_price_list(params) {
    return request.post('/admin/hall/getPrice', params)
}

export function request_hall_detail(params) {
    return request.post('/admin/hall/read', params)
}
export function request_hall_list(params) {
    return request.post('/admin/hall/index', params)
}

export function request_hall_create(params) {
    return request.post('/admin/hall/create', params)
}

export function request_hall_update(params) {
    return request.post('/admin/hall/update', params)
}

export function request_hall_delete(params) {
    return request.post('/admin/hall/delete', params)
}
// 门店
export function request_store_list(params) {
    return request.post('/admin/store/getList', params)
}

export function request_store_create(params) {
    return request.post('/admin/store/create', params)
}

export function request_store_update(params) {
    return request.post('/admin/store/update', params)
}

export function request_store_delete(params) {
    return request.post('/admin/store/delete', params)
}

//  工位
export function request_station_list(params) {
    return request.post('/admin/station/getList', params)
}

export function request_station_create(params) {
    return request.post('/admin/station/create', params)
}

export function request_station_update(params) {
    return request.post('/admin/station/update', params)
}

export function request_station_delete(params) {
    return request.post('/admin/station/delete', params)
}


// 轮播图
export function request_banner_list(params) {
    return request.post('/admin/banner/getList', params)
}

export function request_banner_create(params) {
    return request.post('/admin/banner/create', params)
}

export function request_banner_update(params) {
    return request.post('/admin/banner/update', params)
}

export function request_banner_delete(params) {
    return request.post('/admin/banner/delete', params)
}

// 公告
export function request_notice_list(params) {
    return request.post('/admin/notice/getList', params)
}

export function request_notice_create(params) {
    return request.post('/admin/notice/create', params)
}

export function request_notice_update(params) {
    return request.post('/admin/notice/update', params)
}

export function request_notice_delete(params) {
    return request.post('/admin/notice/delete', params)
}

// 报名部分
export function request_form_list(params) {
    return request.post('/admin/form/getList', params)
}

export function request_form_create(params) {
    return request.post('/admin/form/create', params)
}

export function request_form_update(params) {
    return request.post('/admin/form/update', params)
}

export function request_form_delete(params) {
    return request.post('/admin/form/delete', params)
}

export function request_getbranchs(params) {
    return request.post('/api/user/getBranchs', params)
}

// 管理员部分
export function request_manger_get(params) {
    return request.post('/admin/manager/index', params)
}

export function request_manger_create(params) {
    return request.post('/admin/manager/add', params)
}

export function request_manger_update(params) {
    return request.post('/admin/manager/modify', params)
}

export function request_manger_delete(params) {
    return request.post('/admin/manager/delete', params)
}

export function request_manger_find(params) {
    return request.post('/admin/manager/get', params)
}

export function request_manger_switch(params) {
    return request.post('/admin/manager/switch', params)
}

export function request_user_info(params) {
    return request.post('/admin/manager/getUserInfo', params)
}

export function post(url, params) {
    return request.post(url, params)
}

export function del(url, params) {
    return request.delete(url, {
        params
    })
}

export function put(url, params) {
    return request.put(url, params)
}